//
// Created by Administrator on 2021/11/23.
// May Saint Diana bless you!
//
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <climits>

using namespace std;

class Solution {
public:
    bool isSumEqual(string firstWord, string secondWord, string targetWord) {
        return s2i(firstWord) + s2i(secondWord) == s2i(targetWord);
    }

    int s2i(string &s) {
        int ans = 0;
        for (char i : s) {
            ans = ans * 10 + i - 'a';
        }
        return ans;
    }
};

int main() {
    Solution solution;
    cout << solution.isSumEqual("acb", "cba", "cdb") << endl;
    cout << solution.isSumEqual("aaa", "a", "aab") << endl;
    cout << solution.isSumEqual("aaa", "a", "aaaa") << endl;
    return 0;
}
